<template>
  <span :style="{color:classList}">{{list.id}}{{ text }}</span>
</template>

<script>
export default {
  props: ["list"],
  data() {
    return {
      classList: "#ccc",
      text: "未完成",
    };
  },
  watch: {
    list: {
      deep: true,
      handler(val) {
        console.log(val);
        if (val.status ==="") {
          this.classList = "#ccc";
          this.text = "未完成";
          return;
        } else if (val.status === true) {
          this.classList = "green";
          this.text = "正确";
          return;
        }
        this.classList = "red";
        this.text = "错误";
        return;
      },
    },
  },
};
</script>